﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    interface IFlayable {
        void Takeoff();
        void Fly();
        void Land();
    }
    abstract class Animal {
        private string name;
        public string Name { get {return name; } set {name=value; } }
        public Animal() { }
        public Animal(string name) {
            this.name = name;
        }
        public abstract void  Eat();
    }
    class Vehicle 
    {
        private string brand;
        public string Brand { get { return brand; } set { brand = value; } }
        public Vehicle() { }
        public Vehicle(string brand)
        {
            this.brand = brand;
        }

    }


    class Plane : Vehicle, IFlayable
    {
        private int carrypassange;
        public int CarryPassange { get { return carrypassange; } set { carrypassange = value; } }
        public Plane() { }
        public Plane(int carrypassange)
        {
            this.carrypassange = carrypassange;
        }
        public void Fly()
        {
            Console.WriteLine("{0}飞机正在飞行", this.Brand);
        }

        public void Land()
        {
            Console.WriteLine("{0}飞机正在着陆", this.Brand);
        }

        public void Takeoff()
        {
            Console.WriteLine("{0}飞机正在起飞", this.Brand);
        }
        public void Carry()
        {
            Console.WriteLine("{0}飞机载客{1}人", this.Brand,this.carrypassange);
        }
    }
    class Bird : Animal, IFlayable
    {
        private int layeggs;
   
        public int  Layeggs { get { return layeggs; } set { layeggs = value; } }

        public Bird()
        {
        }
        public Bird(string name,int layeggs) : base(name)
        {
            this.Name = name;
            this.layeggs = layeggs;
        }

        public override void Eat()
        {
            Console.WriteLine("{0}正在吃东西",this.Name);
        }

        public void Fly()
        {
            Console.WriteLine("{0}正在飞", this.Name);
        }

        public void Land()
        {
            Console.WriteLine("{0}已经着陆", this.Name);
        }

        public void Takeoff()
        {
            Console.WriteLine("{0}正准备展翅高飞", this.Name);
        }
        public void Eggs() {
            Console.WriteLine("{0}一年下蛋{1}个",this.Name,this.Layeggs);
        
        }
    }
    class Superman : Animal, IFlayable
    {
        public Superman()
        {
        }
        public Superman(string name) : base(name)
        {
            this.Name = name;
        }

        public override void Eat()
        {
            Console.WriteLine("{0}正在吃东西", this.Name);
        }

        public void Fly()
        {
            Console.WriteLine("{0}正在飞向M78星云", this.Name);
        }

        public void Land()
        {
            Console.WriteLine("{0}着陆引发小规模地震", this.Name);
        }

        public void Takeoff()
        {
            Console.WriteLine("{0}正准备展翅高飞", this.Name);
        }

    }
    class Program
        {
            static void Main(string[] args)
            {
            Plane plane = new Plane();
            plane.Brand = "空客";
            plane.CarryPassange = 100;
            plane.Carry();
            plane.Takeoff();
            plane.Fly();
            plane.Land();

            Console.WriteLine();

            Bird bird = new Bird("燕子",10);
            bird.Takeoff();
            bird.Fly();
            bird.Land();
            bird.Eat();
            bird.Eggs();

            Console.WriteLine();

           Superman s1 = new Superman("奥特曼");
           s1.Eat();
           s1.Takeoff();
           s1.Fly();
           s1.Land();

        }
        }
    }

